/********************************************************************************
 *      Copyright:  (C) 2024 LingYun<iot25@lingyun>
 *                  All rights reserved.
 *
 *       Filename:  thread.h
 *    Description:  This file 
 *
 *        Version:  1.0.0(11/12/24)
 *         Author:  LingYun <iot25@lingyun>
 *      ChangeLog:  1, Release initial version on "11/12/24 18:52:30"
 *                 
 ********************************************************************************/
#ifndef THREAD_MANAGER_H
#define THREAD_MANAGER_H

#include "thread.h" 

typedef void *(THREAD_BODY)(void *thread_arg);

int thread_init(int num_threads);
int create_thread(pthread_t *thread, void *(*start_routine)(void *), void *thread_arg);
int thread_start(pthread_t *thread_id, THREAD_BODY *thread_workbody, void *thread_arg);
void wait_for_threads(pthread_t *threads, int num_threads);
void thread_pool_cleanup(pthread_t *threads, int num_threads);

#endif  // THREAD_MANAGER_H


